package com.github.cosycode.imgtool.tool;

import lombok.AccessLevel;
import lombok.NoArgsConstructor;

import java.util.regex.Pattern;

/**
 * <b>Description : </b>
 * <p>
 * <b>created in </b> 2022/1/6
 * </p>
 *
 * @author CPF
 * @since 1.0
 **/
@NoArgsConstructor(access = AccessLevel.PRIVATE)
public class RegexUtils {

    public static final String WIN_DISK_PATH_REGEX = "[a-zA-z]:[/\\\\].+";

    public static final String MARKDOWN_IMG_REGEX = "!\\[[^\\[\\]]*?\\]\\(([^\\(\\)]+?)\\)";

    public static final String MARKDOWN_IMG_REGEX_DIRECTOR = "(?<=!\\[[^\\[\\]]{0,100}?\\]\\()[^\\(\\)]+?(?=\\))";

    public static final String URL_REGEX = "https?:[/\\\\]{2}.+";

    public static final Pattern MARKDOWN_IMG_PATTERN = Pattern.compile(MARKDOWN_IMG_REGEX);

    public static final Pattern MARKDOWN_IMG_REGEX_PATTERN = Pattern.compile(MARKDOWN_IMG_REGEX_DIRECTOR);

    public static final Pattern URL_PATTERN = Pattern.compile(URL_REGEX);

}
